<template>
  <a-modal
    title="生成账单"
    :width="800"
    :visible="visible"
    @ok="handleOk"
    @cancel="hide"
    :centered="true"
    okText="确定"
  >
    <a-form >
      <a-form-item label="账单时间" style="display: flex">
        <div style="display: flex;align-items: center">{{orderDate}}</div>
      </a-form-item>
      <a-form-item label="快递价格" style="display: flex">
        <div style="display: flex;align-items: center">
          <a-input v-model="express_money" placeholder="请填写快递价格" type="number" style="margin-right: 20px;width: 600px"></a-input>元
        </div>
      </a-form-item>
      <a-form-item label="快递单量" style="display: flex">
        <div style="display: flex;align-items: center">
          <a-input v-model="express_order" placeholder="请填写快递单量" type="number" style="margin-right: 20px;width: 600px"></a-input>个
        </div>
      </a-form-item>
    </a-form>

  </a-modal>
</template>
<script>
import {billShow, billAdd} from "@/api/stat";
export default {
  props: {
    sid: '',
  },
  data() {
    return {
      visible: false,
      express_money: '',
      express_order: '',
      orderDate: ''
    }
  },
  created() {
    this.orderDate = new Date().getFullYear().toString() + '年' + new Date().getMonth().toString() + '月'
  },
  methods: {
    show() {
      this.visible = true;
    },
    hide() {
      this.visible = false;
    },
    handleOk() {
      const params = {
        store_id: this.sid,
        express_money: this.express_money,
        express_order: this.express_order
      }
      billAdd(params).then((res) => {
        this.$message.success('操作成功');
        this.express_money = ''
        this.express_order = ''
        this.$emit('change1')
        this.$emit('change2')
        this.hide();
      })
    }
  },
}
</script>
<style scoped lang="less">
/deep/ .ant-radio-group {
  width: 100%;
}
</style>